const router = require('koa-router')()
const adminModel = require('../model/AdminModel');
router.prefix('/admin')


router.post('/login', async function (ctx, next) {
  try {
    const { phone, passwrod } = ctx.request.body;
    ctx.body = await adminModel.login(phone, passwrod)
  } catch (e) {
    ctx.body = {
      code: 400,
      msg: e.message
    }
  }
})

module.exports = router;